﻿Imports Hinshelwood.TFSStickyBuddy.Modules.Interfaces
Imports Hinshelwood.TFSStickyBuddy.Modules.PresentationModels
Imports Hinshelwood.TFSStickyBuddy.Infrastructure
Imports Microsoft.Practices.Unity
Imports Microsoft.Practices.Composite.Events
Imports Hinshelwood.TFSStickyBuddy.Modules.Views
Imports Hinshelwood.TFSStickyBuddy.Infrastructure.Events

Namespace Presenters

    Public Class TeamSystemHomeGroupPresenter
        Implements ITeamSystemHomeGroupPresenter



        Private m_View As ITeamSystemHomeGroupView
        Private m_Container As IUnityContainer
        Private ReadOnly m_eventAggregator As IEventAggregator
        Private ReadOnly m_NotImplementedEvent As NotImplementedEvent


        Public ReadOnly Property View() As Interfaces.ITeamSystemHomeGroupView Implements Interfaces.ITeamSystemHomeGroupPresenter.View
            Get
                Return m_View
            End Get
        End Property

        Public Sub New(ByVal view As ITeamSystemHomeGroupView, ByVal container As IUnityContainer, ByVal eventAggregator As IEventAggregator)
            m_View = view
            m_Container = container
            m_eventAggregator = eventAggregator
            m_NotImplementedEvent = m_eventAggregator.GetEvent(Of NotImplementedEvent)()
        End Sub


        Public Sub ShowView() Implements Interfaces.ITeamSystemHomeGroupPresenter.ShowView
            View.Model = m_Container.Resolve(Of ITeamSystemSelectionPresentationModel)()
            View.Model.RefreshServers()
        End Sub

    End Class

End Namespace